package com.wondersgroup.insurance.dnuilearn.transitionscence;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.ActivityOptionsCompat;
import android.support.v7.app.AppCompatActivity;
import android.widget.Button;
import android.widget.ImageView;

import com.wondersgroup.insurance.dnuilearn.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Administrator on 2017/7/19.
 */

public class TransitionFirstActivity extends AppCompatActivity {
    @BindView(R.id.btn_next)
    Button btnNext;
    @BindView(R.id.img)
    ImageView img;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_transtion_first);
        ButterKnife.bind(this);

    }

    @OnClick(R.id.btn_next)
    public void onViewClicked() {
        ActivityOptionsCompat comapt= ActivityOptionsCompat.
                makeSceneTransitionAnimation(this, img, getString(R.string.app_name));
//        Pair<View, String> img1 = Pair.create(imageView, getString(R.string.app_name));
//        Pair<View, String> img2 = Pair.create(imageView2, getString(R.string.app));
//        ActivityOptionsCompat comapt= ActivityOptionsCompat.makeSceneTransitionAnimation(this, img1, img2);
        //跳转
        ActivityCompat.startActivity(this,new Intent(this,TransitionSecondActivity.class),comapt.toBundle());
    }
}
